class ModifTableForGather < ActiveRecord::Migration
  def self.up
    add_column  :leechdoms, :category_id, :integer, :null => false
    add_column  :leechdoms, :image_url, :string
    add_column  :leechdoms, :intro, :text
    add_column  :leechdoms, :oid, :integer
    change_column :leechdoms, :application_and_dosage, :text
    change_column :leechdoms, :price, :string
    
    add_column  :factories, :linkman, :string
    add_column  :factories, :intro, :text
    rename_column :factories, :name, :company
    rename_column :factories, :website, :url  
    rename_column :factories, :mail, :email 
  end

  def self.down
    remove_column :leechdoms, :category_id
    remove_column :leechdoms, :image_url
    remove_column :leechdoms, :intro
    remove_column :leechdoms, :oid
    #change_column :leechdoms, :application_and_dosage, :string
    
    remove_column :factories, :linkman
    remove_column :factories, :intro
    rename_column :factories, :company, :name
    rename_column :factories, :url, :website
    rename_column :factories, :email, :mail
  end
end
